package keter.service;

import java.util.List;

import keter.dao.org.UnitDao;
import keter.domain.Unit;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UnitService {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = LoggerFactory.getLogger(UnitService.class);
	
	@Autowired
	private UnitDao dao;
	
	public UnitDao getDao() {
		return dao;
	}

	/**
	 * <p>Method ：findDepartment
	 * <p>Description : 查找下级单元
	 *
	 * @param collegeId
	 * @return 
	 * @author  顾力行-gulixing@msn.com
	 */
	public List<Unit> findByParentId(Long parentId){
	    return dao.findByParentId(parentId);
	}
	
	public Unit findByCode(String code){
	    return dao.findByCode(code);
	}

}
